Conventionally, an electronic key system for a vehicle has been known in which an in-vehicle device mounted in a vehicle and a portable device carried by a user perform code verification between each other using wireless communication, and the in-vehicle device performs vehicle control such as locking/unlocking of vehicle doors or starting of an engine on the basis of the code verification being made successfully. In this type of electronic key system for a vehicle, the range reached by a wireless signal transmitted from the in-vehicle device is limited to a short range around a vehicle. This is for the purpose of limiting the situation in which an authentication process based on the code verification is performed between the in-vehicle device and the portable device to the case where the portable device is present in the vicinity of the vehicle.
However, such an electronic key system for a vehicle raises a concern about a relay attack in which a malicious third party uses a relay to indirectly provide communication between a portable device and an in-vehicle device and thus effect successful code verification. The relay attack enables successful code verification unintended by an authorized user and enables vehicle control such as unlocking of vehicle doors or starting of an engine.
On the other hand, various configurations for preventing such a relay attack have been proposed. For example, Patent Literature 1 discloses an electronic key system for a vehicle in which an in-vehicle device sequentially transmits wireless signals at two types of output levels (i.e., transmission powers) and, only when a portable device detects a level difference between the received signals, a signal is returned from the portable device to the in-vehicle device.
In general, a relay transfers a radio wave in a frequency band to be relayed at a given output level. Accordingly, when the radio wave transmitted from an in-vehicle device is relayed by the relay, a level difference between the received signals, which is to be intrinsically detected, is no longer detected. That is, the configuration in Patent Literature 1 can restrict the portable device from returning a response to the signal from the in-vehicle device that has been relayed by the relay. When no response is returned from the portable device, code verification is unsuccessful (i.e., has failed).